#pragma onece
#include "EventLoop.h"
#include "Buffer.h"
#include "Channel.h"
#include "HttpRequest.h"
#include "HttpResponse.h"

// #define MSG_SEND_AUTO

class TcpConnection
{
public:
    TcpConnection(int32_t fd, struct EventLoop *evLoop);
    ~TcpConnection();
private:
    static int32_t processRead(void *arg);
    static int32_t destroy(void *arg);
    static int32_t processWrite(void *arg);

private:
    EventLoop *m_evLoop;
    Channel *m_channel;
    Buffer *m_readBuff;
    Buffer *m_writeBuff;
    std::string m_name;
    // http协议
    HttpRequest *m_request;
    HttpResponse *m_response;
};
